import Mock from "mockjs";
import { addAddress, addCart, addressDetail, addresses, cartItems, cartProductDetail, changePasword, changeUserInfo, currentUser, defaultAddress, homeData, loginResult, logoutRes, orderList, orderResult, productDetail, products1, products2, queryByCategory, registerRes, treeList, updateAddress, updateOrderResult } from "./mock-data";

Mock.mock(/\/api\/v1\.0\/portal\/auth\/logout$/, "post", logoutRes);

Mock.mock(/\/api\/v1\.0\/portal\/auth\/login\?username=m1&password=aaaaaa&verifycode=7xv6$/, "post", loginResult);

Mock.mock(/\/api\/v1\.0\/portal\/auth\/login\?username=m2&password=aaaaaa&verifycode=7xv6$/, "post", loginResult);

Mock.mock(/\/api\/v1\.0\/portal\/member\/register$/, "POST", registerRes);

Mock.mock(/\/api\/v1\.0\/portal\/home\/data$/, "get", homeData);

Mock.mock(/\/api\/v1\.0\/portal\/product\?page=0&size=[0-9]+$/, "get", products1);

Mock.mock(/\/api\/v1\.0\/portal\/product\?page=1&size=[0-9]+$/, "get", products2);

Mock.mock(/\/api\/v1\.0\/portal\/product\/[0-9]+$/, "get", productDetail);

Mock.mock(/\/api\/v1\.0\/portal\/cart-item\?page=[0-9]+&size=[0-9]+$/, "get", cartItems);

Mock.mock(/\/api\/v1\.0\/portal\/cart-item$/, "post", addCart);

Mock.mock(/\/api\/v1\.0\/portal\/cart-item\/query\?ids=[0-9]+$/, "get", cartProductDetail);

Mock.mock(/\/api\/v1\.0\/portal\/address\/default$/, "get", defaultAddress);

Mock.mock(/\/api\/v1\.0\/portal\/address$/, "get", addresses);

Mock.mock(/\/api\/v1\.0\/portal\/address\/[0-9]+$/, "get", addressDetail);

Mock.mock(/\/api\/v1\.0\/portal\/address$/, "put", updateAddress);

Mock.mock(/\/api\/v1\.0\/portal\/address$/, "post", addAddress);

Mock.mock(/\/api\/v1\.0\/portal\/order$/, "post", orderResult);

Mock.mock(/\/api\/v1\.0\/portal\/order$/, "put", updateOrderResult);

Mock.mock(/\/api\/v1\.0\/portal\/order\/query$/, "post", orderList);

Mock.mock(/\/api\/v1\.0\/portal\/auth\/current$/, "get", currentUser);

Mock.mock(/\/api\/v1\.0\/portal\/member$/, "put", changeUserInfo);

Mock.mock(/\/api\/v1\.0\/portal\/member\/change-password$/, "put", changePasword);

Mock.mock(/\/api\/v1\.0\/portal\/category\/treelist$/, "get", treeList);

Mock.mock(/\/api\/v1\.0\/portal\/product\/query$/, "post", queryByCategory);